/**
 * Keafmd
 *
 * @ClassName: Test2
 * @Description: Test2
 * @author: lijl
 * @date: 2022/12/9 15:52
 * @Blog: https://keafmd.blog.csdn.net/
 */


class Area{
//    private int weight;
//    private int height;
//    private int width;
//    Area() {
//
//    }

    int getArea(int a, int b) {
        return a * b;//求长方形面积

    }
    int getArea(int a, int b, int c) {
        return (a * b + a * c + b * c) * 2;
    }
}
class Square extends Area{
    int getArea(int a) {
        return a * a;//求正方形面积

    }
}
public class Test2 {
    public static void main(String[] args) {
        Area area1 = new Area();
        System.out.println(area1.getArea(2, 3));//长方形的面积
        System.out.println(area1.getArea(3, 4, 5));//长方体的面积
        Square square = new Square();
        System.out.println(square.getArea(3));
    }
}
